const mongoose = require('mongoose')
const Schema = mongoose.Schema
const ObjectId = Schema.Types.ObjectId

const Log = new mongoose.Schema({
  log_name: String,
  log_content: String,
  log_publishtime: {
    type: Date,
    default: Date.now()
  },
  group_id: {
    type: ObjectId,
    ref: 'Group'
  },
  sprint_id: {
    type: ObjectId,
    ref: 'Sprint'
  },
  log_status: { // 0是草稿，1是已发布， 2是已删除
    type: Number,
    default: 2
  },
  log_operator: String, // 发布者
  log_attachment: String
})
module.exports = mongoose.model('Log', Log)
